Skip to content

hide cat toogle in case only one cat is available#2599

Merged
google-oss-prow[bot] merged 5 commits intokubeflow:mainfrom
Philip-Carneiro:show-full-grid-when-one-cat-is-available
Apr 22, 2026
Merged

hide cat toogle in case only one cat is available#2599
google-oss-prow[bot] merged 5 commits intokubeflow:mainfrom
Philip-Carneiro:show-full-grid-when-one-cat-is-available

Conversation

@Philip-Carneiro
Copy link
Copy Markdown
Contributor

@Philip-Carneiro Philip-Carneiro commented Apr 15, 2026

Description

When only one category is available for Model Catalog or MCP Catalog, the grid only show 4 cards and need to click in a link/toggle to show all the cards from that category.
These changes are made for when this happens, it shows all the cards available in that category (until the load more button appear)

  • Added getActiveSourceLabels utility function
  • Implemented conditional rendering logic

With this changes the behaviour will be:

  1. Multiple active categories: Normal behaviour with category toggle visible
  2. Single active category: Toggle hidden, category auto-selected via useEffect
  3. No active categories: Empty state displayed

Before:

  • non-PF mode:
before-model-non-pf before-mcp-non-pf
  • PF mode:
before-mcp-pf before-model-pf

After:

  • non-PF mode:
after-mcp-non-pf after-model-non-pf
  • PF mode:
after-model-pf after-mcp-pf

How Has This Been Tested?

It was manually tested, also crated unit tests and 3 new cypress tests

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages
  • Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.
  • For first time contributors: Please reach out to the Reviewers to ensure all tests are being run, ensuring the label ok-to-test has been added to the PR.

If you have UI changes

  • The developer has added tests or explained why testing cannot be added.
  • Included any necessary screenshots or gifs if it was a UI change.
  • Verify that UI/UX changes conform the UX guidelines for Kubeflow.

@google-oss-prow google-oss-prow Bot requested review from chambridge and fege April 15, 2026 13:56
@Philip-Carneiro Philip-Carneiro force-pushed the show-full-grid-when-one-cat-is-available branch 2 times, most recently from cc67bcc to 0716acc Compare April 17, 2026 12:17
Copy link
Copy Markdown
Contributor

@ppadti ppadti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Philip-Carneiro !!
one question - @mturley @Philip-Carneiro
when there's only 1 category the toggle is hidden, but now the user has no way to know which category they're viewing. Would it be better to show the name and description when we have 1 category or should we leave it as is, not sure.

@manaswinidas
Copy link
Copy Markdown
Contributor

manaswinidas commented Apr 17, 2026

+1 to Pushpa's suggestion - I think name and description should be there

@Philip-Carneiro Philip-Carneiro force-pushed the show-full-grid-when-one-cat-is-available branch from 0716acc to 9f285d4 Compare April 20, 2026 07:30
@google-oss-prow google-oss-prow Bot added size/XL and removed size/L labels Apr 20, 2026
@Philip-Carneiro Philip-Carneiro force-pushed the show-full-grid-when-one-cat-is-available branch from c073d6e to 31544d2 Compare April 20, 2026 08:55
@Philip-Carneiro Philip-Carneiro requested a review from ppadti April 20, 2026 09:02
Comment thread clients/ui/frontend/src/app/pages/modelCatalog/screens/ModelCatalog.tsx Outdated
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
@Philip-Carneiro Philip-Carneiro force-pushed the show-full-grid-when-one-cat-is-available branch from 31544d2 to b2d9a83 Compare April 22, 2026 11:18
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
@Philip-Carneiro Philip-Carneiro requested a review from ppadti April 22, 2026 11:59
Copy link
Copy Markdown
Contributor

@ppadti ppadti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Philip-Carneiro for the back and forth. The fix for the useEffect guard and the singleCategoryLabel prop looks good on the Model Catalog side — could we mirror the same changes in McpCatalog.tsx and McpCatalogGalleryView.tsx as well?

@Philip-Carneiro Philip-Carneiro requested a review from ppadti April 22, 2026 12:54
Signed-off-by: Philip Colares Carneiro <philip.colares@gmail.com>
@Philip-Carneiro
Copy link
Copy Markdown
Contributor Author

The fix for the useEffect guard and the singleCategoryLabel prop looks good on the Model Catalog side — could we mirror the same changes in McpCatalog.tsx and McpCatalogGalleryView.tsx as well?

I add the change requested

Copy link
Copy Markdown
Contributor

@ppadti ppadti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@google-oss-prow google-oss-prow Bot added the lgtm label Apr 22, 2026
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ppadti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot merged commit c6ee0da into kubeflow:main Apr 22, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants